package com.chinasofti.framework.base;

import android.content.Context;
import android.graphics.drawable.Drawable;

public class AndroidUtils {
	
	
	public static int toPx(Context context, int dp) {
		final float scale = context.getResources().getDisplayMetrics().density;
	    int px = (int) (dp * scale + 0.5f);
	    return px;
	}
	
	public static Drawable getResourceImage(Context context, int id) {
		return context.getResources().getDrawable(id);
	}

	
}
